﻿using System;

namespace 第三次csharpe作业
{
    class Program
    {
        static void Main(string[] args)
        {
            //九九乘法表
                for (int a = 1; a <= 9; a++)
                {
                    for (int b = 1; b <= a; b++)

                    {
                        Console.Write("{0}x{1}={2}\t", b, a, a * b);
                    }
                    Console.WriteLine();


                //菱形

                Console.WriteLine("请输入奇数：");
                int x = Int32.Parse(Console.ReadLine());
                int y = (x - 1) / 2;

                for (int a1 = 1; a1 <= y; a1++)  
                {
                    for (int c = 1; c <= y - a1 + 1; c++)
                    {
                        Console.Write(" ");
                    }
                    for (int b1 = 1; b1 <= a1; b1++)
                    {
                        Console.Write("* ");
                    }
                    Console.WriteLine();
                }
                for (int z = 1; z <= y + 1; z++)  
                {
                    Console.Write("* ");

                }
                Console.WriteLine();
                for (int a2 = y; a2 >= 1; a2--)  
                {
                    for (int c1 = 0; c1 <= y - a2; c1++)
                    {
                        Console.Write(" ");
                    }
                    for (int b2 = 1; b2 <= a2; b2++)
                    {
                        Console.Write("* ");
                    }
                    Console.WriteLine();
                }


                Console.ReadLine();
            }
            }
    }
}
